<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
	<ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
		<li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
		<li class="active" ng-bind="title"></li>
		<a style="float: right;margin-right: 12%;margin-top: -10px;" 
			has-permission permission='finance.accountRec.add'	ui-sref="main.finance.accountRec.create" class="btn btn-sm btn-info">
			<i class="icon-user-follow m-r-sm text-md"></i>申请充值</a>
	</ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
	<!-- 数据显示 -->
	<div class="wrapper-data">
		<div class="panel panel-default">
			<!-- 头部 -->
			<div class="panel-body">
					<form ng-submit="searchRe()" class="form-horizontal">
					<div class="form-group">

						<div class="col-md-2">
							<input type="text" class="form-control" placeholder="请输入用户ID" ng-model="param.userId"  onkeyup="if(!/^\d+$/.test(this.value)) { this.value='';}">
						</div>
							<div class="col-md-2">
								<input type="text" ng-model="param.applyMinDate" id="applyMinDate" placeholder="开始申请时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
							</div>
                        <div class="col-md-2">
                            <input type="text" ng-model="param.applyMaxDate" id="applyMaxDate" placeholder="结束申请时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
						<div class="col-md-2">
							<input type="text" ng-model="param.approveMinDate" id="approveMinDate" placeholder="开始交易时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
						</div>
                        <div class="col-md-2">
                            <input type="text" ng-model="param.approveMaxDate" id="approveMaxDate" placeholder="结束交易时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>


						<div class="col-md-2">
							<select class="form-control" ng-model="param.rechargeStatus">
								<option value="">--交易状态--</option>
								<option value="1">待审核</option>
								<option value="2">审核完成</option>
								<option value="3">审核失败</option>
								<option value="4">已取消</option>
								<option value="5">付款完成</option>
							</select>
						</div>
					</div>
					<div class="form-group">
                        <div class="col-md-2">
                            <input ng-model="param.minAmount" class="form-control" placeholder="充值金额（小）" type="text"/>
                        </div>

                        <div class="col-md-2">
                            <input ng-model="param.maxAmount" class="form-control" placeholder="充值金额（大）" type="text"/>
                        </div>

						<div class="col-md-2">
							<select class="form-control" ng-model="param.rechargeType">
								<option value="">--交易类型--</option>
								<option value="0">线上</option>
								<option value="1">线下</option>
							</select>
						</div>
						<div class="col-md-2">
								<select class="form-control" ng-model="param.accountType">
									<option value="">--充值方式--</option>
									<option value="1">支付宝</option>
									<option value="2">财付通</option>
									<option value="3">银行转账</option>
									<option value="4">现金</option>
									<option value="5">返现</option>
									<option value="6">冲销</option>
								</select>
						</div>
						<div class="col-md-1">
							<label class="col-sm-1 control-label"><button class="ifc-btn btn-primary" type="submit">查 询</button></label>
						</div>

					<!--	<div class="col-md-1" has-permission permission='finance.accountRec.update'>
							<label class="col-sm-1 control-label"><button  class="ifc-btn btn-success"  ng-click="batchApprove(2)" >批量通过</button></label>
						</div>
						<div class="col-md-1" has-permission permission='finance.accountRec.update' >
							<label class="col-sm-1 control-label"><button class="ifc-btn btn-danger"  ng-click="preview()" >批量失败</button></label>
						</div>-->
					<div class="col-md-1">
						<label class="col-sm-1 control-label"><button class="ifc-btn btn-dark" type="button" ng-click="clearSearch()">清 空</button></label>
					</div>
					</div>
					<div class="cover" ng-show="firstApply">
						<div class="firstApplyWrap">
							<div class="clear"><i class="iconfont closeBtn noselect" ng-click="firstApply=false">&#xe608;</i></div>
							<div class="title" ><textarea  placeholder="请输入审核失败的原因......" class="form-control" rows="5" id="remark"></textarea>
								<div class="modal-footer">
									<button type="button" class="btn btn-default" ng-click="firstApply=false" data-dismiss="modal">取消</button>
									<button type="button" class="btn btn-primary" ng-click="batchApprove('3')">确定</button>
								</div>
							</div>

						</div>
					</div>
				</form>
			</div>
			<!-- 数据表格 -->
			<div class="table-responsive">
				<table class="table table-striped b-t b-light text-center">
					<thead>
					<tr>
						<th><input type="checkbox" ng-click="selectAll($event)" id="all"/>全选</th>
						<th>编号</th>
<!-- 						<th>用户Id</th> -->
						<th>用户Id</th>
						<th>广告主</th>
						<th>打款方式<br/>打款账户</th>
						<!--<th>充值方式</th>-->
						<th>充值金额</th>
						<th>流水号</th>
						<th>申请时间</th>
						<th>交易时间</th>
						<th>类型</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
					<tr ng-repeat="item in pageInfo.records">
						<td><input type="checkbox"  name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item.id,item.iden,item.rechargeStatus)"/></td>
						<td class="v-middle">{{item.id}}</td>
<!-- 						<td class="v-middle">{{item.userId}}</td> -->
						<td class="v-middle">{{item.userId}}</td>
						<td class="v-middle">{{item.companyName}}</td>
						<td class="v-middle">{{item.bankName}}<br/>{{item.cardNumber}}</td>
					<!--	<td class="v-middle">
							<span ng-if="item.accountType=='01'">支付宝</span>
							<span ng-if="item.accountType=='02'">财付通</span>
							<span ng-if="item.accountType=='03'">银行转账</span>
							<span ng-if="item.accountType=='04'">现金</span>
						</td>-->
						<td class="v-middle">{{item.amount}}</td>
						<td class="v-middle">{{item.orderId}}</td>
						<td class="v-middle">{{item.applyDate | date:'yyyy-MM-dd HH:mm:ss'|limitTo:19}}</td>
						<td class="v-middle">{{item.tradeDate | date:'yyyy-MM-dd HH:mm:ss'|limitTo:19}}</td>
						<td class="v-middle">{{item.rechargeType=='0'?'线上':'线下'}}</td>
						<td class="v-middle">
							<span ng-if="item.rechargeStatus=='1'">待审核</span>
							<span ng-if="item.rechargeStatus=='2'">审核完成</span>
							<span ng-if="item.rechargeStatus=='3'">审核失败</span>
							<span ng-if="item.rechargeStatus=='4'">已取消</span>
							<span ng-if="item.rechargeStatus=='5'">付款完成</span>
						</td>
						<td class="v-middle">
							<a ui-sref="main.finance.accountRec.detail({id:item.id,iden:item.iden})" class="btn btn-sm btn-default m-l-xs">
								<i class="fa fa-edit m-r-xs text-sm"></i>详情</a>
						</td>
					</tr>
					</tbody>
				</table>
			</div><!-- /.table-responsive -->

            <!-- 底部分页 -->
			<span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
		</div><!-- /.panel -->
	</div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->
<style>
	.cover {
		position: fixed;
		width: 100%;
		height: 100%;
		background: rgba(0,0,0,0.5);
		z-index: 2000;
		top: 0;
		left: 0;
		/* display: none; */
	}

	.firstApplyWrap{
		width: 550px;
		height:280px;
		background: #fff;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		-webkit-transform: translate(-50%,-50%);
		-ms-transform: translate(-50%,-50%);
		-o-transform: translate(-50%,-50%);
		-moz-transform: translate(-50%,-50%);
		border-radius: 5px;
		overflow: hidden;
	}
	.firstApplyWrap .title{
		font-size: 18px;
		color:#333;
		padding:18px 36px 0 36px;
		text-align: center;
		line-height: 2em;
	}
	.firstApplyWrap .closeBtn,.finishData .closeBtn{
		font-size: 30px;
		padding:5px 10px 0 0;
		border-radius: 50%;
		color: #ccc;
		float: right;
		cursor: pointer;
	}
	.finishData .closeBtn{
		position: absolute;
		top:10px;
		right:10px;
	}
	.firstApplyWrap .bkgIcon{
		position: absolute;
		left: 54px;
		top:87px;
		font-size: 50px;
		color:#FFB136;
	}
	.firstApplyWrap .applyBtnWrap{
		position: absolute;
		bottom: -2px;
		width: 100%;
	}
	.firstApplyWrap .applyBtn{
		width: 50%;
		height:70px;
		line-height: 70px;
		background: #FFB135;
		font-size: 20px;
		text-align: center;
		color:#fff;
		cursor: pointer;
		float:left;
	}
	.firstApplyWrap .applyBtn:last-child{
		background: #5796FC;
	}
</style>